#ifndef SQLITE_H_
#define SQLITE_H_
#include "../global/global.h"

///sqlite3 initialize
int sqliteInit();
int getGlobalPara(char*);
///devlist relative
int initEquipFromSqlite();	///initialize devlist when boot-up
int devSyn();				///synchronous devlist
int addDev(int);
int updateDev(int);
int delDev(int);
///model relative
int addMode(int);
int updateMode(int);
int delMode(int);
int modelOper(int);
int modelQuery(int);
///get/add/del timetask or modeltask
int tmTaskQuery(int,int,int);
int addTask(int);
int delTask(int);
int modifyTask(int);
/////update g_downTask.st_timeTask everyday in 00:00
int updateTask00();
///total-power relative
int inquiryElecPower(int,int,int);
int saveElecPower(int,double);
int inquiryActivePower(int,int,int);
int saveActivePower(int,double);
void delDataByChTime(int);
void delOutdatedData();
int getTodayZero(int);


///debug functions
#ifdef SMARTHOME_DEBUG
void saveComInDatabase(unsigned char*,int,bool);
#endif

#endif
